<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>金字塔</title>
</head>
<body>

<script>
    var num=120;
    for(var i = 0;i<15;i++){
        var nbsp =num-i-1;
        for(var j =0;j<nbsp;j++){
            document.write("&nbsp;");
        }
        var as=(i+1)*2-1;
        for(var k= 0;k<as;k++){
            document.write("*");
        }
        document.write("<br>");
    }
</script>
</body>
</html>